package com.example.springcloudstream.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hh
 * @since 2023/2/26
 */
@RestController
@RequestMapping("stream")
public class StreamController {

    @Autowired
    private StreamBridge streamBridge;

    @GetMapping("sendMsg")
    public String sendMsg(String message) {
        streamBridge.send("uppercase-out-0", message);
        return "发送消息：" + message;
    }

}
